package com.chatplus.application.enumeration;

import com.chatplus.application.common.util.enumeration.NameValueEnum;
import com.chatplus.application.common.util.enumeration.ValueEnumUtils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * AI平台常量
 */
public enum ImgAiPlatformEnum implements NameValueEnum<String> {
    DALL_E_3("【OpenAi】Dall-e-3", "OpenAI");

    private final String name;
    private final String value;

    ImgAiPlatformEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    @JsonValue
    public String getValue() {
        return value;
    }

    @JsonCreator
    public static ImgAiPlatformEnum get(String value) {
        try {
            return ValueEnumUtils.parse(value, ImgAiPlatformEnum.class);
        } catch (Exception e) {
            return null;
        }
    }
}
